package com.tangding.hprose.api.server.command.impl.watch;

import java.util.Map;

import org.springframework.stereotype.Component;

import com.tangding.cache.TableWatchingCache;
import com.tangding.common.exception.GException;
import com.tangding.hprose.api.server.command.Command;
import com.tangding.hprose.api.server.command.Response;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年12月18日_下午4:11:30
 *
 */
@Component
public class CancelWatchingTable implements Command {

	@SuppressWarnings({ "unchecked" })
	@Override
	public Response exe(Object... params) throws GException {
		Map<String, Object> user = (Map<String, Object>) params[params.length - 1];
		String uid = (String) user.get("uid");
		String tableId = (String) (params[0]);
		TableWatchingCache.remove(uid, tableId);
		return doResponseSucc();
	}

}
